package com.bluetooth.xunxun.util;


import com.bluetooth.xunxun.R;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

public class MyAlertDialog extends Dialog {
	Context context;
	String titleStr;
	String messageStr;
	TextView title;
	TextView message;
	Button confirm;
	Button cancel;
	Button finish;

	public MyAlertDialog(Context context, String title, String message) {
		super(context, R.style.edit_AlertDialog_style);
		// TODO Auto-generated constructor stub
		this.context = context;
		this.titleStr = title;
		this.messageStr = message;
	}

	public MyAlertDialog(Context context, int theme) {
		super(context, R.style.edit_AlertDialog_style);
		// TODO Auto-generated constructor stub
		this.context = context;
	}

	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.alertdialog);
		title = (TextView) findViewById(R.id.alertdialog_title_text);
		confirm = (Button) findViewById(R.id.alertdialog_button_ok);
		cancel = (Button) findViewById(R.id.alertdialog_button_cancel);
		finish = (Button) findViewById(R.id.alertdialog_button_final);

		if (titleStr != null)
			title.setText(titleStr);
		else
			title.setText("Title");
		message = (TextView) findViewById(R.id.alertdialog_message_text);
		if (messageStr != null)
			message.setText(messageStr);
		else
			message.setText("message");

		
		UI_Util.setBtnTouchState(confirm, R.drawable.alertdialig_button_up, R.drawable.alertdialig_button_down);
		UI_Util.setBtnTouchState(cancel, R.drawable.alertdialig_button_up, R.drawable.alertdialig_button_down);
		UI_Util.setBtnTouchState(finish, R.drawable.alertdialig_button_up, R.drawable.alertdialig_button_down);
		
	}

}
